import { lazy } from "react";
import { StateType } from "../type";

const Home = lazy(() => import('../pages/Home'));
const Error  = lazy(() => import("../pages/Error"));
const Login = lazy(() => import("../pages/Login"));
const List =  lazy(() =>import('../pages/List'));
const  AGL = lazy(() => import('../pages/AGL'));
const My = lazy(()=>import('../pages/My'));
const Layout = lazy(() =>import("../pages/Layout"));
export  const rendeRoutes: StateType[] = [
     {
        path:'/home/list',
        element: <List />,
     },
      {
         path:'/home/my',
         element: <My />,
      },
      {
         path:'/home/AGL',
         element: <AGL />,
      },
     {
        path:'/home/layout',
        element: <Layout />
     }
]


export const router: StateType[] = [
    {
        path:'/',
        element: <Home />,

    },
    {
        path:'/home',
        element: <Home />,
        children: rendeRoutes
    },
     {
           path:'/login',
           element: <Login />,
     },
     {
          path: "*",
          element: <Error />,
     }

]